﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ZJK
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ZJK;

    /// <summary>
    /// 专家与附件关联记录
    /// </summary>
    public class ZJ_expert_attachment_map : EntityMapping<ZJ_expert_attachment>
    {
        public ZJ_expert_attachment_map()
        {
            Property(x => x.attachment_type, map =>
            {
                map.Column(ZJ_expert_attachment.Columns.attachment_type);
                map.Length(20);
            });

            //所属专家
            ManyToOne(x => x.expert, map =>
            {
                map.Column(ZJ_expert_attachment.Columns.expert_id);
                map.NotNullable(false);
            });

            //所属附件
            ManyToOne(x => x.attachment, map =>
            {
                map.Column(ZJ_expert_attachment.Columns.attachment_id);
                map.NotNullable(false);
            });

            Table(ZJ_expert_attachment.TableName);
        }
    }
}
